package com.ruoyi.web.schedule;


import com.ruoyi.web.service.NewsUpdateCrawlerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
public class NewsUpdateScrawlerSchedule {

    private static final Logger log = LoggerFactory.getLogger(NewsUpdateScrawlerSchedule.class);

    @Autowired
    private NewsUpdateCrawlerService newsUpdateCrawlerService;





    @Scheduled(cron = "0 0 4 * * ?", zone = "Asia/Shanghai")
    public void addDomesticExhibitionActivities() {
        log.info("开始执行资讯动态抓取任务...");
        newsUpdateCrawlerService.crawlAllArticles();
    }
}
